Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@gilbarbara/deep-equal
Advanced tools
@gilbarbara/deep-equal is an npm package that provides functionality to deeply compare two JavaScript objects or values to determine if they are equivalent. It is useful for scenarios where a shallow comparison is insufficient, such as comparing nested objects or arrays.
Deep Comparison of Objects
This feature allows you to deeply compare two objects to check if they are equivalent. The code sample demonstrates comparing two nested objects.
const deepEqual = require('@gilbarbara/deep-equal');
const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { a: 1, b: { c: 2 } };
console.log(deepEqual(obj1, obj2)); // true
Deep Comparison of Arrays
This feature allows you to deeply compare two arrays to check if they are equivalent. The code sample demonstrates comparing two nested arrays.
const deepEqual = require('@gilbarbara/deep-equal');
const arr1 = [1, [2, 3], 4];
const arr2 = [1, [2, 3], 4];
console.log(deepEqual(arr1, arr2)); // true
Deep Comparison of Mixed Types
This feature allows you to deeply compare mixed types, such as objects containing arrays and other objects. The code sample demonstrates comparing two complex nested structures.
const deepEqual = require('@gilbarbara/deep-equal');
const mixed1 = { a: [1, 2, { b: 3 }] };
const mixed2 = { a: [1, 2, { b: 3 }] };
console.log(deepEqual(mixed1, mixed2)); // true
The 'deep-equal' package is a popular alternative for deep comparison of JavaScript objects and values. It provides similar functionality to @gilbarbara/deep-equal but is more widely used and has a larger community.
The 'lodash.isequal' package is part of the Lodash library and offers deep comparison functionality. It is highly optimized and well-maintained, making it a reliable choice for deep equality checks.
The 'fast-deep-equal' package is known for its performance and small size. It provides deep comparison functionality with a focus on speed, making it suitable for performance-critical applications.
Lightweight deep equal comparator.
npm i @gilbarbara/deep-equal
import equal from '@gilbarbara/deep-equal';
equal({ a: 1 }, { a: 1 }); // true
Inspired by fast-deep-equal package. Thanks! ❤️
MIT
FAQs
Tiny deep equal comparator
The npm package @gilbarbara/deep-equal receives a total of 338,405 weekly downloads. As such, @gilbarbara/deep-equal popularity was classified as popular.
We found that @gilbarbara/deep-equal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.